package com.xing.server.util;

import com.xing.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 操作员工具类
 *
 * @author: xingfuhao
 * @create: 2021-12-26 04:12
 */
public class AdminUtil {


    /**
     * 获取当前操作员
     * @return
     */
    public static Admin getCurrentAdmin(){
        return  (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
